package com.example.demo.repository;

import com.example.demo.model.User;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;
import java.util.Optional;

public interface UserRepository extends JpaRepository<User, Integer> {
    List<User> findByRole(User.Role role);

    Optional<User> findByUsername(String username);

    boolean existsByUsernameAndUserIdNot(String username, Integer userId);
}